package tr.richfacesext.components.chart;

import javax.faces.component.UIComponent;
import javax.faces.webapp.UIComponentTag;

import tr.richfacesext.components.ComponentUtils;


/**
 * 
 * @author mert
 *
 */
public class ChartTag extends UIComponentTag {

	private String _value = null;
	private String _converter = null;
	private String _width = null;
	private String _height = null;
	private String _onclick = null;

	
	public void release(){
		super.release();
		_value = null;
		_converter = null;
		_width = null;
		_height = null;
		_onclick = null;
		
	}

	protected void setProperties(UIComponent uicomponent){
		super.setProperties(uicomponent);

		ComponentUtils.setValueProperty(getFacesContext(), uicomponent, _value);
		ComponentUtils.setConverterProperty(getFacesContext(), uicomponent, _converter);
		ComponentUtils.setIntegerProperty(getFacesContext(), uicomponent, "width", _width );
		ComponentUtils.setIntegerProperty(getFacesContext(), uicomponent, "height", _height );
		ComponentUtils.setStringProperty(getFacesContext(), uicomponent, "onclick", _onclick );
	}

	public String getComponentType() {
		return ChartConstants.COMPONENT_TYPE;
	}

	public String getRendererType() {
		return ChartConstants.DEFAULT_RENDERER;
	}

	public void setValue(String value){
		_value = value;
	}

	public void setConverter(String value){
		_converter = value;
	}
	
	public void setWidth(String value){
		_width = value;
	}

	public void setHeight(String value){
		_height = value;
	}
	
	public void setOnclick(String value){
		_onclick = value;
	}
}